This application is based on an application No. H10-245729 filed in Japan, the content of which is hereby incorporated by reference.
(1) Field of the Invention
The present invention applies to a packet filtering apparatus that filters packets In particular, the invention relates to an apparatus, such as that used by a set-top box (hereafter, STB) for receiving a broadcast, that extracts required packets from a plurality of packets that are transferred as a broadcast.
(2) Prior Art
Several techniques for transferring video and audio information as digital information have been developed. Such techniques can be used in broadcasting and other fields, and transfer such digital information as packets that are obtained by dividing the digital information into units of a suitable length and adding information required for transfer. A packet is therefore a processing unit that is indicated to both the transmitter and receiver in advance. The information required for transfer includes the type, size, and transfer destination of each packet. In many cases, such information forms the first part of each packet, and so is called the header information.
The transferred packets are received by a reproduction apparatus (such as an STS that receives a broadcast or a personal computer connected to the Internet) that uses the information in them to reproduce video and audio. In order to extract the video and audio from the packets, the reproduction apparatus first has to select only the required packets out of the various packets it receives. This processing for selecting the right packets can be achieved exclusively by software that is executed by the CPU in the reproduction apparatus. However, to reduce the processing load of the CPU, this packet selecting will generally be executed by specialized packet selecting hardware (hereafter, a filtering apparatus) that is independent of the CPU.
In digital broadcasts (and digital communication in general), a field denoting a version number showing the position of a packet in the order of packets is given at a specified position in header information. For certain kinds of packets (such as those including information for a list of broadcast programs), the same information is broadcast consecutively and cyclically to guarantee that the reproduction apparatus will be able to immediately obtain the latest information, even if the reproduction apparatus has been switched on midway through a broadcast.
In general, a packet with the same content as a preceding packet with the same packet type will be given the same version number. Conversely, a packet with the same packet type but a content that follows the preceding packet will be given a version number that is one greater than that of the preceding packet. Such version number is reset to zero on exceeding a maximum value.
A conventional filtering apparatus that is provided in a reproduction apparatus passes (i.e., selects) packets that are consecutively transmitted according to a filter condition whereby the version number has to match a specific value. When version numbers are used for packets, the filtering apparatus will only select a packet of a specified type if the version number of the packet follows the version number of the previously received packet of that type. The selected packet is then used by the reproduction apparatus in the processing it performs thereafter.
The following is a detailed description of the selection of packets by a conventional filtering apparatus in detail, with reference to FIGS. 1 to 6.
FIG. 1 is a block diagram showing the construction of a conventional filtering apparatus 131. FIG. 2 shows examples of the filtering conditions stored in the filtering condition storage unit 1314. Here, assume that the construction and operation of the reproduction apparatus that includes the filtering apparatus 131 are fundamentally the same as those of the STB 3 explained in the xe2x80x9cDescription of the Preferred Embodimentsxe2x80x9d with reference to FIGS. 8 and 9, etc.
As shown in FIG. 1, the conventional filtering apparatus 131 includes a packet obtaining unit 1311, a filtering unit 1312, a packet outputting unit 1313, a filtering condition storage unit 1314 and a filtering condition setting unit 1315.
The packet obtaining unit 1311 obtains a packet from a broadcasting center via a wired or wireless transfer path, and sends the packet to the filtering unit 1312. The filtering control unit indicates the filtering conditions to the filtering condition setting unit 1315, which then stores the indicated filtering conditions in the filtering condition storage unit 1314.
As shown in FIG. 2, each filtering condition stored in the filtering condition storage unit 1314 is composed of a filtering condition number for specifying the filtering condition, a comparison data position, and comparison data. The filtering condition number is composed of a one-byte integer, while the comparison data position and comparison data are each composed of an eight-byte integer. All these values are expressed in hexadecimal. Note that the comparison data position and comparison data are explained later in this text.
The filtering unit 1312 operates as follows. When a packet is received from the packet obtaining unit 1311, the filtering unit 1312 applies the filtering conditions stored in the filtering condition storage unit 1314, judges whether the obtained packet is necessary, and sends only the packets it has judged to be necessary to the packet outputting unit 1313. The packet outputting unit 1313 stores the packets transferred in this way into a buffer memory. This buffer memory has a plurality of areas, with packets being stored into different areas according to which filtering condition they satisfy. Video and audio reproduction then take place using the packets that have been stored into the buffer memory.
The following is a detailed description of the control procedure by which the above conventional filtering apparatus 131 performs filtering by judging whether the obtained packets are necessary.
FIG. 3 is a flowchart showing the control procedure for the filtering of packets by a conventional filtering apparatus 131 (shown in FIG. 1). FIG. 4 shows the actual packets that are obtained by the packet obtaining unit 1311.
In the example shown in FIG. 4, the packet obtaining unit 1311 obtains packets 501 to 509 one at a time in that order. In each packet, one-byte units of data are successively obtained in the order shown from left to right (1A, 3F, 05, AB . . . ) in FIG. 4.
The following describes the filtering by the filtering apparatus 131. First, a packet to be stored in the buffer memory is specified according to an indication from the filtering control unit. In accordance with this packet, filtering conditions, such as those shown in FIG. 2, are set by the filtering condition setting unit 1315 and are stored in the filtering condition storage unit 1314 (S201). After this, the packet obtaining unit 1311 obtains the next packet to arrive via the transfer path (S202), and one of the filtering conditions stored in the filtering condition storage unit 1314 is selected (S203).
Suppose here that the plurality of filtering conditions are applied one a time in order of the filtering condition numbers to packet 501 that has been obtained by the packet obtaining unit 1311, Tn such case, filtering condition#1 is selected, and it is judged whether packet 501 satisfies this filtering condition. After this, filtering condition#2 is selected as the next filtering condition and the judgement is performed again for packet 501.
A logical AND is taken for the comparison data position of the selected filtering condition and the first eight bytes of the packet obtained by the packet obtaining unit 1311, and the result is substituted into the variable x (S204). The comparison data is substituted into the variable y (S205).
In an actual example, the value 0000000000000090 is substituted into the variable x as a result of the logical AND taken for the comparison data position 00000000000000FF of filtering condition#1 and the data 1A3F05AB22C60090 of packet 501 obtained by the packet obtaining unit 1311. The comparison data 0000000000000080 is substituted into the variable y.
Next, it is judged whether the variables x and y are equal (S206). If so (S206:Yes), the packet that has been obtained by the packet obtaining unit 1311 is stored in the buffer memory via the packet outputting unit 1313 (S207). It is then judged whether all of the packets that were indicated by the filtering control unit have been stored in the buffer memory (S208). If so (S208:Yes), the present procedure ends (S208:Yes). If this is not the case (S208:No), the filtering conditions stored in the filtering condition storage unit 1314 are updated to new filtering conditions for the next packet to be stored in the buffer (S209).
If the variables x and y are not equal (S206:No), it is then judged whether all of the filtering conditions have been applied (S210). It not (S210:No), the processing returns to S203 where a different filtering condition (i.e., a filtering condition with a different filtering condition number) is selected, and the above procedure is repeated. If all of the filtering conditions have been applied (S210:Yes), a new packet is obtained in S202 and the above procedure is repeated.
When the values given above are substituted into the variables x and y, these variables will not be equal, so that packet 501 obtained by the packet obtaining unit 1311 will not satisfy filtering condition#1 and will not be stored in the buffer memory. For filtering condition#2, however, the variables x and y are both set at the value 000000AB22000000. Since the variables x and y are equal, packet 501 satisfies filtering condition#2, and so is stored in the buffer memory.
With the conventional filtering apparatus 131, the above processing is repeated for packets 501-509 in order to filter the transferred packets.
The following describes the filtering of packets by a conventional filtering apparatus 131 when one of the filtering conditions described above relates to the version number of a packet.
FIG. 5 shows filtering conditions relating to version numbers that can be stored in the filtering condition storage unit 1314 (see FIG. 1). In this example, it is assumed that packets 501-509, such as those shown in FIG. 4, are transferred in order, with packets 501-503 having the same content, as do packets 504-506 and packets 507-509. It is also assumed that the third byte from the start of a packet shows the version number of the packet. Note that while a variety of different arrangements are used for packets, filtering based on numbers that show the order of packets will still be possible using a similar kind of procedure.
The conventional filtering apparatus 131 operates according to the above control procedure. As a result, the comparison data position 0000FF0000000000 and the comparison data 0000050000000000 are stored in the filtering condition storage unit 1314 as the filtering condition, based on control by the filtering control unit (the processing in S201 of FIG. 3). This filtering condition shows that the third byte showing the version number is five. The packet obtaining unit 1311 obtains packet 501 (the processing in S202), and it is judged whether the data set in the filtering apparatus 131 is equal to data included in packet 501 (the processing in S206). Packet 501 satisfies the condition that the third byte showing the version number is five (corresponding to the result xe2x80x9cYesxe2x80x9d in S206), so that packet 501 is stored via the packet outputting unit 1313 into the buffer memory (the processing in S207). Once packet 501 with the version number 5 has been obtained, the filtering condition stored in the filtering condition storage unit 1314 is updated according to control by the filtering control unit so that the comparison data position becomes 0000FF0000000000 and the comparison data becomes 0000060000000000 (the processing in S209). This updated filter condition requires that the third byte showing the version number is six.
As time passes, packet 502 and packet 503, which have the same content as packet 501, are transmitted to the reproduction apparatus and are obtained by the packet obtaining unit 1311. However, since packets 502 and 503 do not satisfy the above filter condition, these packets are not outputted toward the packet outputting unit 1313 and so are not stored in the buffer memory.
After packets 502 and 503, packet 504 with the version number six arrives at the reproduction apparatus and is obtained by the packet obtaining unit 1311. In accordance with the above control procedure of the filtering unit 1312, this packet 504 is outputted to the packet outputting unit 1313 and is stored in the buffer memory.
Control by the filtering control unit increments the version number to seven (i.e., the corresponding filtering condition is set), and the above processing is performed so that packets 505 and 506 that have the same content as packet 504 are not stored into the buffer memory, though the packet, packet 507, with the version number 7 that is obtained by the packet obtaining unit 1311 after these packets is stored into the buffer memory via packet outputting unit 1313.
FIG. 6 shows the filtering performed by a conventional filtering apparatus 131. When packets 501-509 include consecutive packets with the same content, the filtering condition will be properly updated according to the control shown in FIG. 3, so that packets 501, 504, and 507 are obtained in accordance with the version numbers and are outputted to the packet outputting unit 1313. This means that appropriate filtering is performed, with a plurality of packets with the same content not being stored into the buffer memory.
With this kind of filtering apparatus, however, a large number of packets may be lost even if there is only a minor disruption to the communication on the transfer path.
As described above, the filtering apparatus filters packets using a filtering condition whereby the version number is equal to a value given by adding one to the version number of the previously obtained packet of the same type. Note that once the highest version number has been assigned to packet(s), the version number is reset to zero, so that the version numbers are used cyclically.
Here, suppose there is a temporary disruption to the transfer path that prevents all packets with a version number that satisfies the filtering condition from being received. The version number assigned to packets is restored to zero after reaching its maximum value, which means that the packet with the version number that satisfies the next filtering condition will be a packet in a next cycle with this version number. All packets from the packets with a version number equal to a value produced by adding one to the version number of the packet that last satisfied the filtering condition to the packets with a version number that is one less than this value will not be processed, in spite of having changing contents that should be processed by the reproduction apparatus.
This is described in more detail below, with reference to FIG. 7 that shows the effects of a communication disruption on the filtering of packets by a conventional filtering apparatus 131. In this example, packets are properly received up to packet 503, with a communication disruption occurring on the transfer path immediately after packet 503 has been received. This disruption results in packets 504-506 failing to reach the reproduction apparatus.
On successfully receiving packet 501, the filtering apparatus 131 sets xe2x80x9cversion number=6xe2x80x9d as the filtering condition. This means that none of the packets obtained by the packet obtaining unit 1311 (see FIG. 1) from packet 507 with the version number#7 onward will satisfy this filtering condition This will continue until the version number of the transferred packets reaches its maximum value (here, 255), returns to zero, and thereafter increases once again so that a packet with the version number#6 is received.
As described above, a temporary disruption to communication on a transfer path will prevent a conventional filtering apparatus from properly filtering for one whole cycle of packets. This means that a reproduction apparatus will not process packets during this time, so that the processing cannot proceed as normal. When the packets include video data, for example, this means that the reproduction of video images corresponding to such video data will be interrupted.
The present invention was conceived in view of the above problems with the conventional art, and has an object of providing a packet filtering apparatus that can flexibly and efficiently filter packets, while minimizing the effects of a failure of certain packets to arrive due to a disruption to the communication.
The stated object can be achieved by a packet filtering apparatus for selectively outputting packets out of a plurality of inputted packets. This packet filtering apparatus stores a plurality of conditions, each condition being specified by (1) a partial data position that indicates a position of a data part of a packet, (2) comparison data to which the data part is to be compared, and (3) a comparison criterion for comparing the data part and comparison data, with different conditions including different comparison criteria. One of the stored plurality of conditions is selected. Based on the selected condition, the data part of one inputted packet is compared with the comparison data according to the comparison criterion and the packet is allowed to pass depending on a comparison result.
With the stated construction, a plurality of (filtering) conditions including different comparison criteria are selectively applied to individual packets, so that the filtering of packets both flexible and efficient.
The packet filtering apparatus may update, when the inputted packet does not satisfy the selected condition, the selected condition to a different one of the stored plurality of conditions. Based on the updated condition, the packet filtering apparatus may then compare a data part of the inputted packet with the comparison data according to the comparison criterion and selectively allow the packet to pass depending on a comparison result for the updated condition.
With the stated construction, the selected condition is suitably updated to a condition including a different comparison criterion, so that the filtering of packets is both flexible and efficient.
Here packet filtering apparatus may also indicate which part of a predetermined memory should be used for storing data of a selectively passed packet, based on which condition was satisfied by the selectively passed packet.
With the stated construction, a plurality of conditions including different comparison criteria are selectively applied to individual packets, making the filtering of packets both flexible and efficient. The processing of the filtered data can be performed smoothly in accordance with the position in the memory into which the data of packets has been stored.
Here, the data part of a packet may show a position of the packet in an order assigned to the plurality of packets.
With the stated construction, the effects of a failure of certain packets to arrive due to a disruption to the communication are minimized, so that the filtering of packets is both flexible and efficient.
Here, at least one of the stored plurality of conditions may include a comparison criterion relating to whether the data part and the comparison data are not equal, and a packet may be allowed to pass if the data part and the comparison data are not equal. Also, at least one of the stored plurality of conditions may include a comparison criterion relating to relative magnitudes of the data part and the comparison data, and a packet may be allowed to pass if the data part of the packet and the comparison data satisfy the comparison criterion relating to the relative magnitudes.
Due to the use of the above comparison criteria, the filtering of packets is both flexible and efficient.
Here, the packet may either of an MPEG (Moving Pictures Experts Group) transport stream packet and an MPEG packetized elementary stream packet.
With the stated construction, flexible and efficient filtering can be performed for transport stream packets or packetized elementary stream packets.
The stated object can also be achieved by a packet filtering apparatus for selectively outputting packets out of a plurality of inputted packets. The packet filtering apparatus stores a plurality of type 2 conditions, each type 2 condition being composed of a plurality of type 1 conditions, each type 1 condition being specified by (1) a partial data position that indicates a position of a data part of a packet, (2) comparison data to which the data part is to be compared, and (3) a comparison criterion for comparing the data part and comparison data. The type 2 conditions are composed such that the comparison criteria in the type 1 conditions differ, either between the type 1 conditions in a same type 2 condition or between the type 1 conditions in different type 2 conditions. One type 2 condition is selected out of the stored plurality of type 2 conditions. By applying each type 1 condition in the selected type 2 condition one at a time, the data part of one inputted packet is compared with the comparison data according to the comparison criterion and the packet is selectively allowed to pass only if a comparison result xe2x80x9ctruexe2x80x9d is given for every type 1 condition in the selected type 2 condition.
With the stated construction, a plurality of conditions are applied to packets and only packets that satisfy all of the conditions are passed. These makes the filtering of packets efficient and highly flexible.